﻿<%@ Page Title="Usuario" Language="C#" MasterPageFile="~/gymmaster.Master" AutoEventWireup="true"
    CodeBehind="CadastroUsuario.aspx.cs" Inherits="GymMaster.View.Cadastro.CadastroUsuario" %>

<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="cc1" %>
<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
    <asp:ScriptManager ID="ScriptManager1" runat="server">
    </asp:ScriptManager>
    <asp:UpdatePanel runat="server" ID="UpdatePanel" UpdateMode="Conditional">
        <ContentTemplate>
            <table cellpadding="4" cellspacing="0" class="table" style="border-collapse: collapse;"
                align="center">
                <tr>
                    <td align="center" colspan="2" class="titletable">
                        <asp:Label ID="lblNomePagina" runat="server" Text="Cadastro Usuário"></asp:Label>
                    </td>
                </tr>
                <tr>
                    <td style="width: 45%" align="right">
                        <asp:Label ID="lblNome" runat="server">Nome: </asp:Label>
                    </td>
                    <td align="left">
                        <asp:TextBox ID="txtNome" runat="server" Width="250px" MaxLength="299"></asp:TextBox>
                        <asp:RequiredFieldValidator ID="UserNameRequired" runat="server" ControlToValidate="txtNome"
                            ValidationGroup="CreateUserWizard1">* Campo obrigatório.</asp:RequiredFieldValidator>
                    </td>
                </tr>
                <!-- Nome -->
                <tr>
                    <td style="width: 45%" align="right">
                        <asp:Label ID="Label1" runat="server">CPF: </asp:Label>
                    </td>
                    <td align="left">
                        <asp:DropDownList ID="ddlSexo" runat="server" Width="250px">
                            <asp:ListItem Selected="True" Value="F">Feminino</asp:ListItem>
                            <asp:ListItem Value="M">Masculino</asp:ListItem>
                        </asp:DropDownList>
                        <asp:RequiredFieldValidator ID="RequiredFieldValidator9" runat="server" ControlToValidate="ddlSexo"
                            ValidationGroup="CreateUserWizard1">* Campo obrigatório.</asp:RequiredFieldValidator>
                    </td>
                </tr>
                <!-- SEXO -->
                <tr>
                    <td style="width: 45%" align="right">
                        <asp:Label ID="lblCpf" runat="server">CPF: </asp:Label>
                    </td>
                    <td align="left">
                        <asp:TextBox runat="server" Width="250px" ID="txtCpf" Class="cpf" MaxLength="14"></asp:TextBox>
                        <asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" ControlToValidate="txtCpf"
                            ValidationGroup="CreateUserWizard1">* Campo obrigatório.</asp:RequiredFieldValidator>
                    </td>
                </tr>
                <!-- CPF -->
                <tr>
                    <td style="width: 45%" align="right">
                        <asp:Label ID="lblRg" runat="server">RG: </asp:Label>
                    </td>
                    <td align="left">
                        <asp:TextBox ID="txtRg" runat="server" Width="250px" MaxLength="20"></asp:TextBox>
                        <asp:RequiredFieldValidator ID="RequiredFieldValidator2" runat="server" ControlToValidate="txtRg"
                            ValidationGroup="CreateUserWizard1">* Campo obrigatório.</asp:RequiredFieldValidator>
                    </td>
                </tr>
                <!-- RG -->
                <tr>
                    <td style="width: 45%" align="right">
                        <asp:Label ID="lblSenha" runat="server">Senha: </asp:Label>
                    </td>
                    <td align="left">
                        <asp:TextBox ID="txtSenha" runat="server" TextMode="Password" Width="250px" MaxLength="50"></asp:TextBox>
                        <asp:RequiredFieldValidator ID="PasswordRequired" runat="server" ControlToValidate="txtSenha"
                            ValidationGroup="CreateUserWizard1">* Campo obrigatório.</asp:RequiredFieldValidator>
                    </td>
                </tr>
                <!-- Senha -->
                <tr>
                    <td style="width: 45%" align="right">
                        <asp:Label ID="lblConfSenha" runat="server">Confirmação senha: </asp:Label>
                    </td>
                    <td align="left">
                        <asp:TextBox ID="txtConfSenha" runat="server" TextMode="Password" Width="250px" MaxLength="50"
                            OnFocus="txtConfSenha_onFocus"></asp:TextBox>
                        <asp:RequiredFieldValidator ID="ConfirmPasswordRequired" runat="server" ControlToValidate="txtConfSenha"
                            ValidationGroup="CreateUserWizard1">* Campo obrigatório.</asp:RequiredFieldValidator>
                    </td>
                </tr>
                <!-- Confere Senha -->
                <tr>
                    <td style="width: 45%" align="right">
                        <asp:Label ID="lblPerfil" runat="server" Text="Perfil:"></asp:Label>
                    </td>
                    <td align="left">
                        <asp:DropDownList ID="ddlPerfil" runat="server" Width="254px" DataSourceID="edsPerfil"
                            DataTextField="NOME" DataValueField="ID_PERFIL">
                        </asp:DropDownList>
                        <asp:RequiredFieldValidator ID="RequiredFieldValidator8" runat="server" ControlToValidate="ddlPerfil"
                            ValidationGroup="valEmpresa">* Campo obrigatório.</asp:RequiredFieldValidator>
                        <asp:EntityDataSource ID="edsPerfil" runat="server" ConnectionString="name=GymMasterEntities"
                            DefaultContainerName="GymMasterEntities" EnableFlattening="False" EntitySetName="PERFIL">
                        </asp:EntityDataSource>
                    </td>
                </tr>
                <!-- Perfil -->
                <tr>
                    <td style="width: 45%" align="right">
                        <asp:Label ID="lblNascimento" runat="server">Data Nascimento: </asp:Label>
                    </td>
                    <td align="left">
                        <asp:TextBox ID="txtNascimento" runat="server" Width="250px" Class="data" MaxLength="10"></asp:TextBox>
                        <%--
                        <asp:Image ID="imgNascimento" runat="server" ImageUrl="~/images/Calendar.png" Height="17px"
                            Width="19px" />
                                        
                        <cc1:CalendarExtender ID="CalendarExtender1" runat="server" TargetControlID="txtNascimento">
                        </cc1:CalendarExtender>
                        --%>
                        <asp:RequiredFieldValidator ID="RequiredFieldValidator3" runat="server" ControlToValidate="txtNascimento"
                            ValidationGroup="valEmpresa">* Campo obrigatório.</asp:RequiredFieldValidator>
                    </td>
                </tr>
                <!-- Data Nascimento -->
                <tr>
                    <td style="width: 45%" align="right">
                        <asp:Label ID="lblRua" runat="server" Text="Rua:"></asp:Label>
                    </td>
                    <td align="left">
                        <asp:TextBox ID="txtRua" runat="server" Width="250px" MaxLength="299"></asp:TextBox>
                        <asp:RequiredFieldValidator ID="RequiredFieldValidator4" runat="server" ControlToValidate="txtRua"
                            ValidationGroup="valEmpresa">* Campo obrigatório.</asp:RequiredFieldValidator>
                    </td>
                </tr>
                <!-- Rua -->
                <tr>
                    <td style="width: 45%" align="right">
                        <asp:Label ID="lblNumero" runat="server" Text="Número:"></asp:Label>
                    </td>
                    <td align="left">
                        <asp:TextBox ID="txtNumero" runat="server" Width="250px" Class="numero" MaxLength="10"></asp:TextBox>
                        <asp:RequiredFieldValidator ID="RequiredFieldValidator5" runat="server" ControlToValidate="txtNumero"
                            ValidationGroup="valEmpresa">* Campo obrigatório.</asp:RequiredFieldValidator>
                    </td>
                </tr>
                <!-- Numero -->
                <tr>
                    <td style="width: 45%" align="right">
                        <asp:Label ID="lblComplemento" runat="server" Text="Complemento:"></asp:Label>
                    </td>
                    <td align="left">
                        <asp:TextBox ID="txtComplemento" runat="server" Width="250px" MaxLength="299"></asp:TextBox>
                    </td>
                </tr>
                <!-- Complemento -->
                <tr>
                    <td style="width: 45%" align="right">
                        <asp:Label ID="lblBairro" runat="server" Text="Bairro:"></asp:Label>
                    </td>
                    <td align="left">
                        <asp:TextBox ID="txtBairro" runat="server" Width="250px" MaxLength="250"></asp:TextBox>
                        <asp:RequiredFieldValidator ID="RequiredFieldValidator6" runat="server" ControlToValidate="txtBairro"
                            ValidationGroup="valEmpresa">* Campo obrigatório.</asp:RequiredFieldValidator>
                    </td>
                </tr>
                <!-- Bairro -->
                <tr>
                    <td style="width: 45%" align="right">
                        <asp:Label ID="lblEstado" runat="server" Text="Estado:"></asp:Label>
                    </td>
                    <td align="left">
                        <asp:DropDownList ID="ddlEstado" runat="server" Width="254px" AutoPostBack="True"
                            DataSourceID="edsEstado" DataTextField="NOM_ESTADO" DataValueField="COD_ESTADO">
                        </asp:DropDownList>
                        <asp:EntityDataSource ID="edsEstado" runat="server" ConnectionString="name=GymMasterEntities"
                            DefaultContainerName="GymMasterEntities" EnableFlattening="False" EntitySetName="ESTADO"
                            EntityTypeFilter="ESTADO">
                        </asp:EntityDataSource>
                    </td>
                </tr>
                <!-- Estado -->
                <tr>
                    <td style="width: 45%" align="right">
                        <asp:Label ID="lblCidade" runat="server" Text="Cidade:"></asp:Label>
                    </td>
                    <td align="left">
                        <asp:DropDownList ID="ddlCidade" runat="server" Width="254px">
                        </asp:DropDownList>
                        <asp:RequiredFieldValidator ID="RequiredFieldValidator7" runat="server" ControlToValidate="ddlCidade"
                            ValidationGroup="valEmpresa">* Campo obrigatório.</asp:RequiredFieldValidator>
                    </td>
                </tr>
                <!-- Cidade -->
                <tr>
                    <td style="width: 45%" align="right">
                        <asp:Label ID="lblCep" runat="server" Text="CEP:"></asp:Label>
                    </td>
                    <td align="left">
                        <asp:TextBox ID="txtCep" runat="server" Width="250px" Class="cep" MaxLength="10"></asp:TextBox>
                    </td>
                </tr>
                <!-- Cep -->
                <tr>
                    <td style="width: 45%" align="right">
                        <asp:Label ID="lblEmail" runat="server">E-mail:</asp:Label>
                    </td>
                    <td align="left">
                        <asp:TextBox ID="txtEmail" runat="server" Width="250px" MaxLength="250"></asp:TextBox>
                        <asp:RegularExpressionValidator ID="regexEmailValid" runat="server" ValidationExpression="\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*"
                            ControlToValidate="txtEmail" ErrorMessage="E-mail invalido."></asp:RegularExpressionValidator>
                        <asp:RequiredFieldValidator ID="EmailRequired" runat="server" ControlToValidate="txtEmail"
                            ValidationGroup="CreateUserWizard1">* Campo obrigatório.</asp:RequiredFieldValidator>
                    </td>
                </tr>
                <!-- Email -->
                <tr>
                    <td style="width: 45%" align="right">
                        <asp:Label ID="lblObs" runat="server" Text="Observação:"></asp:Label>
                    </td>
                    <td align="left">
                        <textarea id="txtObs" rows="3" cols="29" runat="server" maxlength="500"></textarea>
                    </td>
                </tr>
                <!-- Observacao -->
                <tr>
                    <td align="center" colspan="2">
                        <asp:CompareValidator ID="PasswordCompare" runat="server" ControlToCompare="txtSenha"
                            ControlToValidate="txtConfSenha" Display="Dynamic" ErrorMessage="Senha não confere."
                            ValidationGroup="CreateUserWizard1"></asp:CompareValidator>
                    </td>
                </tr>
                <!-- Valida Senha -->
                <tr>
                    <td style="width: 45%" align="center" colspan="2" style="color: Red;">
                        <asp:Literal ID="ErrorMessage" runat="server" EnableViewState="False"></asp:Literal>
                    </td>
                </tr>
                <tr>
                    <td align="center" colspan="2">
                        <asp:Button ID="btnCancelar" runat="server" CssClass="button" Text="Cancelar" />
                        &nbsp&nbsp&nbsp&nbsp&nbsp
                        <asp:Button ID="btnCadastrar" runat="server" CommandName="Submit" CssClass="button"
                            Text="Cadastrar" ValidationGroup="CreateUserWizard1" OnClick="btnCadastrar_Click" />
                    </td>
                </tr>
            </table>
        </ContentTemplate>
    </asp:UpdatePanel>
</asp:Content>
